<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Profile extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->config->load('themes');		
		$theme = $this->config->item('homepage');
		if($theme == "" || !isset($theme))
			$theme = $this->config->item('global_theme');
			
		$this->load->model('profile_model');
		
		$this->data['css_dir'] = base_url()."assets/themes/".$theme."/css/";
		$this->data['js_dir'] = base_url()."assets/themes/".$theme."/js/";		
		$this->data['img_dir'] = base_url()."assets/themes/".$theme."/images/";		
		$this->theme = $theme;
		$this->data['logged_in'] = $this->session->userdata('user_logged');	

		if($this->data['logged_in']){
			$this->data['notifications'] = Array();
			$this->data['members'] = $this->data_fetcher->fetch_table('tb_mas_members',null,null,Array('fk-tb_mas_bands'=>$this->session->userdata('intID')));
			if(count($this->data['members']) < 3)
					array_push($this->data['notifications'],'You have not met the minimum required number of band members(3) yet.');
		
			$vtest = $this->session->userdata('strVideoFileName');
			if(!isset($vtest) || $vtest == '')
				array_push($this->data['notifications'],'You have not uploaded a video yet.');
		}
		$this->data['main_menu'] = $this->load->view('common/main_menu',$this->data,true);		
	
	}
	
	public function index()
	{
	 
	}
		
	
	public function view_profile($band_id)
	{
		$this->data['profile'] = $this->profile_model->get_band_info($band_id);
		$this->data['members'] = $this->profile_model->get_band_members($band_id);
		$this->data['title'] = "Band Profile - ".$this->data['profile']['strName'];
		$this->load->view('header',$this->data);
		$this->load->view('content',$this->data);
		$this->load->view('footer',$this->data);
		$this->load->view('profile_js',$this->data);
	}
		
		

}